import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;


public class ListVehicles {
	
	private String imageName;
	private ArrayList<SpaceVehicle> vehicles = null;
	Random r = new Random();
	int spaceVehicleType;
	int sizeList;
	int headPosition;
	SpaceVehicle vehicle;
	PanelGame pan=null;
	//private List<FlyingView> viewVehicles = Collections.synchronizedList(new ArrayList<FlyingView>()); 
	//private ArrayList<Observer> listObserver = new ArrayList<Observer>();
	

	

	public ListVehicles(PanelGame pan)
	{	
		setSpaceVehicleType(r.nextInt(4)+1);
		setSizeList(r.nextInt(8)+5);
		setHeadPosition(r.nextInt(600));
		this.pan=pan;
		
		vehicles = new ArrayList<SpaceVehicle>();
		
		for(int i=0; i<getSizeList();i++)
		{	
			
			SpaceVehicle vehicle = new SpaceVehicle(801,getHeadPosition(),"space"+getSpaceVehicleType()+".PNG");
			FlyingView viewVehicle = new FlyingView(vehicle); 
			pan.addView(viewVehicle);
			vehicles.add(vehicle);
			
			
		}

	}
	
	
	
	public int getHeadPosition() {
		return headPosition;
	}

	public void setHeadPosition(int headPosition) {
		this.headPosition = headPosition;
	}
	
	public int getSizeList() {
		return sizeList;
	}

	public void setSizeList(int sizeList) {
		this.sizeList = sizeList;
	}
	
	public int getSpaceVehicleType() {
		return spaceVehicleType;
	}

	public void setSpaceVehicleType(int spaceVehicleType) {
		this.spaceVehicleType = spaceVehicleType;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	public String getImageName() {
		return imageName;
	}

	


	
	/*public void updateObserver() {
		// TODO Auto-generated method stub
		for(Observer obs : this.listObserver )
			obs.update();
		
	}



	@Override
	public void delObserver() {
		// TODO Auto-generated method stub
		this.listObserver = new ArrayList<Observer>();
	}



	@Override
	public void addObserver(Observer obs) {
		// TODO Auto-generated method stub
		this.listObserver.add(obs);
	}*/

}
